package com.astro.domain.bean;

import java.util.Date;

import javax.persistence.*;

@Entity @Table(name="TBL_USER")
@NamedQueries( { @NamedQuery(name = "TblUser.UpdatePassword", query = "update TblUser model set model.password=:password, model.updatedBy=:updatedBy, model.updatedDate=:updatedDate where model.email=:email"),
    			 @NamedQuery(name = "TblUser.DeleteByUserId", query = "delete TblUser model where model.userId=:userId"),
    			 @NamedQuery(name = "TblUser.UpdateTblUser",  query = "update TblUser model set model.updatedBy=:updatedBy, model.updatedDate=:updatedDate where model.userId=:userId"),
    			 @NamedQuery(name = "TblUser.LockTblUser",    query = "update TblUser model set model.locked=:locked, model.updatedDate=:updatedDate where model.email=:email"),
    			 @NamedQuery(name = "TblUser.UpdateLastLogin",query = "update TblUser model set model.dateLastAccessed=:dateLastAccessed where model.email=:email")
})
public class TblUser implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@SequenceGenerator(name = "tblUserGen", sequenceName = "TBL_USER_SEQ")
	@Column (name = "USER_ID")
	private Long userId;
	@Column (name = "EMAIL")
	private String email;
	@Column (name = "STATUS")
	private String status;
	@Column (name = "PASSWORD")
	private String password;
	@Column (name = "LOCKED")
	private String locked;
	@Column (name = "ENABLED")
	private String enabled;
	@Column (name ="DATEPWCHANGED")
	private Date datepwChanged;
	@Column (name ="DATELASTACCESSED")
	private Date dateLastAccessed;
	@Column (name = "GROUP_CODE")
	private String groupCode;
	@Column (name = "CREATED_BY")
	private String createdBy;
	@Column (name = "CREATED_DATE")
	private Date createdDate;
	@Column (name = "UPDATED_BY")
	private String updatedBy;
	@Column (name = "UPDATED_DATE")
	private Date updatedDate;

	// Constructors

	/** default constructor */
	public TblUser() {
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public String getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedDate() {
		return updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public String getLocked() {
		return locked;
	}

	public void setLocked(String locked) {
		this.locked = locked;
	}

	public Date getDatepwChanged() {
		return datepwChanged;
	}

	public void setDatepwChanged(Date datepwChanged) {
		this.datepwChanged = datepwChanged;
	}

	public Date getDateLastAccessed() {
		return dateLastAccessed;
	}

	public void setDateLastAccessed(Date dateLastAccessed) {
		this.dateLastAccessed = dateLastAccessed;
	}

	public String getEnabled() {
		return enabled;
	}

	public void setEnabled(String enabled) {
		this.enabled = enabled;
	}

	public String getGroupCode() {
		return groupCode;
	}

	public void setGroupCode(String groupCode) {
		this.groupCode = groupCode;
	}
 
}